$(() => {
    // 基于$.ajax进行二次封装
    const myajax = (type, url, data, success) => {

        let processData = true
        let contentType = "application/x-www-form-urlencoded"
        if (data instanceof FormData) {
            processData = false
            contentType = false
        }

        $.ajax({
            type,      //请求方法
            url: 'http://localhost:8080/api/v1' + url,       //请求地址
            headers: {
                Authorization: localStorage.getItem('dsj_token')
            },
            data,      //请求参数
            processData,
            contentType,
            success,
        })
    }
    window.myjax = myajax
})